

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>mindspore.dataset.audio.transforms.AllpassBiquad &mdash; MindSpore master documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="mindspore.dataset.audio.transforms.AmplitudeToDB" href="mindspore.dataset.audio.transforms.AmplitudeToDB.html" />
    <link rel="prev" title="mindspore.dataset.audio" href="../mindspore.dataset.audio.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html" class="icon icon-home"> MindSpore
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">MindSpore Python API</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../mindspore.html">mindspore</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.common.initializer.html">mindspore.common.initializer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.communication.html">mindspore.communication</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.compression.html">mindspore.compression</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.context.html">mindspore.context</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.html">mindspore.dataset</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../mindspore.dataset.audio.html">mindspore.dataset.audio</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../mindspore.dataset.audio.html#mindspore-dataset-audio-transforms">mindspore.dataset.audio.transforms</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">mindspore.dataset.audio.transforms.AllpassBiquad</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.AmplitudeToDB.html">mindspore.dataset.audio.transforms.AmplitudeToDB</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.Angle.html">mindspore.dataset.audio.transforms.Angle</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.BandBiquad.html">mindspore.dataset.audio.transforms.BandBiquad</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.BandpassBiquad.html">mindspore.dataset.audio.transforms.BandpassBiquad</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.BandrejectBiquad.html">mindspore.dataset.audio.transforms.BandrejectBiquad</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.BassBiquad.html">mindspore.dataset.audio.transforms.BassBiquad</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.ComplexNorm.html">mindspore.dataset.audio.transforms.ComplexNorm</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.Contrast.html">mindspore.dataset.audio.transforms.Contrast</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.FrequencyMasking.html">mindspore.dataset.audio.transforms.FrequencyMasking</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.LowpassBiquad.html">mindspore.dataset.audio.transforms.LowpassBiquad</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.TimeMasking.html">mindspore.dataset.audio.transforms.TimeMasking</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.dataset.audio.transforms.TimeStretch.html">mindspore.dataset.audio.transforms.TimeStretch</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../mindspore.dataset.audio.html#mindspore-dataset-audio-utils">mindspore.dataset.audio.utils</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.config.html">mindspore.dataset.config</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.text.html">mindspore.dataset.text</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.transforms.html">mindspore.dataset.transforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.vision.html">mindspore.dataset.vision</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.mindrecord.html">mindspore.mindrecord</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.html">mindspore.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.probability.html">mindspore.nn.probability</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.transformer.html">mindspore.nn.transformer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.numpy.html">mindspore.numpy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.ops.html">mindspore.ops</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.parallel.html">mindspore.parallel</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.parallel.nn.html">mindspore.parallel.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.profiler.html">mindspore.profiler</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.scipy.html">mindspore.scipy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.train.html">mindspore.train</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.boost.html">mindspore.boost</a></li>
</ul>
<p class="caption"><span class="caption-text">MindSpore C++ API</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://www.mindspore.cn/lite/api/zh-CN/master/api_cpp/mindspore.html">MindSpore Lite↗</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">MindSpore</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../mindspore.dataset.audio.html">mindspore.dataset.audio</a> &raquo;</li>
        
      <li>mindspore.dataset.audio.transforms.AllpassBiquad</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/api_python/dataset_audio/mindspore.dataset.audio.transforms.AllpassBiquad.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="mindspore-dataset-audio-transforms-allpassbiquad">
<h1>mindspore.dataset.audio.transforms.AllpassBiquad<a class="headerlink" href="#mindspore-dataset-audio-transforms-allpassbiquad" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="mindspore.dataset.audio.transforms.AllpassBiquad">
<em class="property">class </em><code class="sig-prename descclassname">mindspore.dataset.audio.transforms.</code><code class="sig-name descname">AllpassBiquad</code><span class="sig-paren">(</span><em class="sig-param">sample_rate</em>, <em class="sig-param">central_freq</em>, <em class="sig-param">Q=0.707</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.dataset.audio.transforms.AllpassBiquad" title="Permalink to this definition">¶</a></dt>
<dd><p>给音频波形施加双极点全通滤波器，其中心频率和带宽由入参指定。</p>
<p>全通滤波器能够改变音频频率与相位的关系，而不改变频率与幅度的关系，其系统函数为：</p>
<div class="math notranslate nohighlight">
\[H(s) = \frac{s^2 - \frac{s}{Q} + 1}{s^2 + \frac{s}{Q} + 1}\]</div>
<p>接口实现方式类似于 <a class="reference external" href="http://sox.sourceforge.net/sox.html">SoX库</a> 。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>待处理音频维度需为(…, time)。</p>
</div>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>sample_rate</strong> (int) - 采样频率（单位：Hz），不能为零。</p></li>
<li><p><strong>central_freq</strong> (float) - 中心频率（单位：Hz）。</p></li>
<li><p><strong>Q</strong> (float, 可选) - <a class="reference external" href="https://zh.wikipedia.org/wiki/%E5%93%81%E8%B3%AA%E5%9B%A0%E5%AD%90">品质因子</a> ，能够反映带宽与采样频率和中心频率的关系，取值范围为(0, 1]，默认值：0.707。</p></li>
</ul>
<p><strong>样例：</strong></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">waveform</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mf">2.716064453125e-03</span><span class="p">,</span> <span class="mf">6.34765625e-03</span><span class="p">],</span> <span class="p">[</span><span class="mf">9.246826171875e-03</span><span class="p">,</span> <span class="mf">1.0894775390625e-02</span><span class="p">]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">numpy_slices_dataset</span> <span class="o">=</span> <span class="n">ds</span><span class="o">.</span><span class="n">NumpySlicesDataset</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">waveform</span><span class="p">,</span> <span class="n">column_names</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;audio&quot;</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">transforms</span> <span class="o">=</span> <span class="p">[</span><span class="n">audio</span><span class="o">.</span><span class="n">AllpassBiquad</span><span class="p">(</span><span class="mi">44100</span><span class="p">,</span> <span class="mf">200.0</span><span class="p">)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">numpy_slices_dataset</span> <span class="o">=</span> <span class="n">numpy_slices_dataset</span><span class="o">.</span><span class="n">map</span><span class="p">(</span><span class="n">operations</span><span class="o">=</span><span class="n">transforms</span><span class="p">,</span> <span class="n">input_columns</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;audio&quot;</span><span class="p">])</span>
</pre></div>
</div>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="mindspore.dataset.audio.transforms.AmplitudeToDB.html" class="btn btn-neutral float-right" title="mindspore.dataset.audio.transforms.AmplitudeToDB" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../mindspore.dataset.audio.html" class="btn btn-neutral float-left" title="mindspore.dataset.audio" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2021, MindSpore.

    </p>
  </div>
    
    
    
    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>